﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Improve157
{
    public class Chapter_02
    {
        public void Suggestion_16()
        {
            int[] iArr = { 1, 2, 3, 4, 5 };
            ArrayList arryList = new ArrayList();
            arryList.AddRange(iArr);

            ArrayList arrayList2 = ArrayList.Adapter(iArr);

            List<int> intList = new List<int>();
            intList.AddRange(iArr);

            List<int> intList2 = iArr.ToList<int>();

            //将数组内容复制到另外一个数组中
            //Array.Copy();

            

        }


        public void Suggstion_18()
        {
            Dog2 dog2 = new Dog2() { Age = 1,Name = "阿拉斯基"};
            dog2.List.Add("123");
            
        }

        public void Suggestion_22()
        {
            ArrayList arrayList = new ArrayList();
            //arrayList.SyncRoot;
        }
    }

    public class Dog2
    {
        public int Age { get; set; }
        private string name;
        public string Name
        {
            get { return name; }
            set
            {
                name = value;
            }
        }
        public Dog2()
        {
            List = new List<string>();
        }

        public List<String> List { get; private set; }
    }
}
